package com.lyrcsoft.springcloudnetflixribbondemo.config;

import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author fujc2dev@126.com
 * @date 2024-08-26
 */
@Configuration
public class RibbonConfig {

	@Bean
	// 这里加上@LoadBalanced
	//@LoadBalanced
	public RestTemplate newRestTemplate(RestTemplateBuilder builder) {
		return builder.build();
	}
}
